package com.example.design.decorator.coffeeebar;

import com.example.design.decorator.cake.EggDecorator;
import com.example.design.decorator.cake.SausageDecorator;
import com.example.design.decorator.coffeeebar.component.Drink;
import com.example.design.decorator.coffeeebar.concretecomponent.Cappuccino;
import com.example.design.decorator.coffeeebar.concretedecorator.Chocolate;
import com.example.design.decorator.coffeeebar.concretedecorator.Milk;
import com.example.design.decorator.coffeeebar.concretedecorator.Sugar;

/**
 * @Description 装饰者模式测试类，饮料加作料
 * @ClassName CoffeeBarTest
 * @Author Administrator
 * @Date 2020/5/13 16:14
 * @Version 1.0.0
 */
public class CoffeeBarTest {

    public static void main(String[] args) {

        Drink drink = new Cappuccino();
        System.out.println(drink.getDescription() + ", 销售价格: " + drink.cost());

        drink = new Milk(drink);
        System.out.println(drink.getDescription() + ", 销售价格: " + drink.cost());

        drink = new Sugar(drink);
        System.out.println(drink.getDescription() + ", 销售价格: " + drink.cost());

        drink = new Chocolate(drink);
        System.out.println(drink.getDescription() + ", 销售价格: " + drink.cost());
    }
}
